<?php
use yii\db\Schema;
use yii\db\Migration;

/**
 * 友情链接表
 *
 * @author jois
 */
class m150828_054536_create_friend_links_table extends Migration
{

    public function up()
    {
        $this->createTable('friend_links', [
            'id' => Schema::TYPE_PK,
            'name' => Schema::TYPE_STRING . ' NOT NULL',
            'link_url' => Schema::TYPE_STRING . ' NOT NULL',
            'sort' => Schema::TYPE_INTEGER . ' NOT NULL DEFAULT 100',
            'created_at' => Schema::TYPE_INTEGER . ' NOT NULL',
            'updated_at' => Schema::TYPE_INTEGER . ' NOT NULL',
        ]);
        $this->createIndex('friend_links_name_index', 'friend_links', 'name', true);
    }

    public function down()
    {
        $this->dropTable('friend_links');
    }
}
